<%@ Reference Control="~/Controls/Member.ascx" %>
<%@ Page language="vb" EnableViewStateMac="true" Inherits="_2bMatesSite.post_member_blog_comment" ValidateRequest=false CodeFile="post_member_blog_comment.aspx.vb" CodeFileBaseClass="_2bMatesSite.BaseWebPage" %>
<%@ Register TagPrefix="Member" TagName="Member" Src="Controls/Member.ascx" %>
<FORM id="Form1" method="post" runat="server">
	<table border="0" cellpadding="0" cellspacing="0" width="100%" align="center" height="100%">
		<tr runat=server id="trUserShortCut">
			<td colspan=3  align="center">
				<member:member runat="server" id="ucMemberShortcut"/>
			</td>
		</tr>
		<tr>
			<td class="page_title" colspan="3"><asp:literal id="litPostBlogComment" runat="server">Post Blog Comment</asp:literal></td>
		</tr>	
		<TR>
			<td valign="top" height="100%" class="main_table_border" align=left>
				<div class="content">
					<TABLE cellSpacing="0" cellPadding="0" border="0" class="main_text_opposite_form">
						<TR>
							<TD align="right" colSpan="2"><asp:hyperlink id="hlReturnToBlog" cssclass="main_text_bold" runat="server" Font-Bold="True">Return to Blog List </asp:hyperlink>&nbsp;</TD>
						</TR>
						<TR>
							<TD class="small" align="left" colSpan="2" id="error">&nbsp;
								<asp:validationsummary id="ValidationSummary1" runat="server" CssClass="val_summary" DisplayMode="List"
									ForeColor="#F04C03" Height="32px"></asp:validationsummary></TD>
						</TR>
						<TR>
							<TD width="60"><B><asp:Literal id="litMessage" runat=server>Message</asp:Literal></B></TD>
							<TD vAlign="top"><asp:textbox id="txtMessage" runat="server" CssClass="scrollbar" TextMode="MultiLine" Rows="8"
									Width="400px" MaxLength="10000" height="200px"></asp:textbox><asp:requiredfieldvalidator id="rvMessage" runat="server" ErrorMessage="Please fill in field Message" ControlToValidate="txtMessage"
									Display="None"></asp:requiredfieldvalidator></TD>
						</TR>
						<tr>
							<td>&nbsp;</td>
							<td class="small" height="10" align="left"><input type=button value="Add link" name=btnAddLink onclick="javascript: addLink('_ctl0:txtMessage')" class="btn" style="WIDTH:70px"  onmouseover="ButtonMouseOver(this);" onmouseout="ButtonMouseOut(this);">&nbsp; 
              &nbsp;<input type=button value="Add image" name=btnAddImage  onclick="javascript: addImage('_ctl0:txtMessage')" class="btn" style="WIDTH:80px"  onmouseover="ButtonMouseOver(this);" onmouseout="ButtonMouseOut(this);"></td>
						</tr>														
						<TR>
							<TD class="small" colSpan="2" height="10">&nbsp;</TD>
						</TR>
						<TR>
							<td>&nbsp;</td>
							<TD class="small" align="left" colSpan="2" height="21"><asp:button id="btnPostBlogComment" runat="server" CssClass="btn" Width="50px" Text="Post"  onmouseover="ButtonMouseOver(this);" onmouseout="ButtonMouseOut(this);" onclick="btnPostBlogComment_Click"></asp:button></TD>
						</TR>
					</TABLE>
				</div>								
			</td>
			<!-- BEGIN SKYSCRAPER ADVERTISEMENT -->	
			<!--
			<td class="small" width="10">&nbsp;</td>
			<td class="border_adv" vAlign="top" width="203" height="100%">
				<table cellSpacing="1" cellPadding="0" width="100%" border="0">
					<tr>
						<td class="small" width="10">&nbsp;</td>
						<td class="advertisement" width="193"><asp:Literal id="litSkyscraperAdvertisement" runat=server></asp:literal></td>
					</tr>
				</table>
			</td>-->
			<!-- END SKYSCRAPER ADVERTISEMENT -->
		</TR>
	</table>
</FORM>
<script>
	// Add blog link/image functionality

	//Function to add link
	var g_messageBox;
	
	function addLink(messageBox){
		var linkPath = new String()
		linkPath = popLinkWin("link", messageBox);
		
		addLinkNS (linkPath);
		//if (typeof(linkPath)!="undefined") {
		//	msgBox = eval("document.forms[0]['" + messageBox + "']")
		//	msgBox.value = msgBox.value + "<%=sLinkTag%>" + linkPath + " ";				
		//}
	}
	
	function addLinkNS(linkPath){		
		if (typeof(linkPath)!="undefined") {
			msgBox = eval("document.forms[0]['" + g_messageBox + "']")
			msgBox.value = msgBox.value + "<%=sLinkTag%>" + linkPath + " ";				
		}
	}

	//Function to add image
	function addImage(messageBox) {	
		var linkPath = new String()
		linkPath = popLinkWin("image", messageBox);
		
		addImageNS(linkPath);
		
		//if (typeof(linkPath)!="undefined") {
		//	msgBox = eval("document.forms[0]['" + messageBox + "']")
		//	msgBox.value = msgBox.value + "<%=sImageTag%>" + linkPath + " ";				
		//}
	}
	
	function addImageNS(linkPath) {	
		if (typeof(linkPath)!="undefined") {
			msgBox = eval("document.forms[0]['" + g_messageBox + "']")
			msgBox.value = msgBox.value + "<%=sImageTag%>" + linkPath + " ";				
		}
	}
		
	function showDialog(url, width, height, messageBox) {
		var sFeatures;
		sFeatures="dialogWidth: "+width+"px; ";
		sFeatures+="dialogHeight: "+height+"px; ";
		sFeatures+="help: no; ";
		sFeatures+="resizable: no; ";
		sFeatures+="scroll: no; ";
		sFeatures+="status: yes; ";
		sFeatures+="unadorned: no; ";

		var result, oWin;
		
		g_messageBox = messageBox;
		
		if (document.all) {
			result = window.showModalDialog(url,"", sFeatures);
		} else {
			oWin = window.open(url,"","width="+width+"px, height="+height+"px");
		}
			
		return result;
		
	}

	function popLinkWin(sType, messageBox) {
		return showDialog("add_link.aspx?type=" + sType, 400, 168, messageBox);
	}
</script>

